# 主入口函数
from vnsumscope.event import EventEngine

from vnsumscope.trader.engine import MainEngine
from vnsumscope.trader.ui import create_qapp
from vnsumscope.app.data_manager import DataManagerApp
from vnsumscope.app.cta_backtester import CtaBacktesterApp

from vnsumscope.trader.ui.mainwindow import MainWindow
from vnsumscope.app.portfolio_strategy import BondStrategyApp


def main():
    """"""
    qapp = create_qapp()

    event_engine = EventEngine()

    main_engine = MainEngine(event_engine)

    # main_engine.add_app(BondStrategyApp)
    # main_engine.add_app(CtaBacktesterApp)
    main_engine.add_app(DataManagerApp)

    main_window = MainWindow(main_engine, event_engine)
    main_window.showMaximized()

    qapp.exec()


if __name__ == "__main__":
    main()
